<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h1>slot</h1>
    <ul>
        <li>slot标签用于定义组件的插槽，其内部的内容作为默认内容。</li>
        <li>在使用具有插槽的组件时，组件标签的内容，会被放入到插槽中。</li>
        <li>放入插槽的内容，可以是文字，标签，甚至是组件。</li>
    </ul>
    <template id="tem1">
        <a :href="url">
            <slot>点击我</slot>
        </a>
    </template>
    <main id="app">
        <div>
            <my-link></my-link>
        </div>
        <div>
            <my-link url="https://www.bilibili.com">
                <img src="https://i0.hdslb.com/bfs/archive/ca375eb31fa90b8e23b88ed3433c2f60de1c2e6e.png">
            </my-link>
        </div>
        <div>
            <my-link url="https://www.bilibili.com">
                哔哩哔哩一下
            </my-link>
        </div>
    </main>
</body>
<script src="../vue.min.js"></script>
<script>
    new Vue({
        el: "#app",
        components: {
            "my-link": {
                template: "#tem1",
                props: {
                    url: {
                        type: String,
                        default: "https://www.baidu.com"
                    }
                }
            },
        }
    })
</script>
</html>